package com.servicesDirectory.action.organisation;

import java.util.List;

import javax.swing.JOptionPane;

import com.opensymphony.xwork2.ActionSupport;
import com.servicesDirectory.common.vo.organisation.SupportingMaterialVO;
import com.servicesDirectory.dao.organisation.SupportingMaterialDAOImpl;
import com.servicesDirectory.dao.programme.BaseProgrammeDAOImpl;

public class SupportingMaterialAction extends ActionSupport {
	public SupportingMaterialDAOImpl dao = null;
	public SupportingMaterialVO supportingMaterial = null;
	public List<SupportingMaterialVO> spmList;
	private static final long serialVersionUID = 1L;
	protected SupportingMaterialVO spm;
	private boolean checkInclude;

    @Override
    public String execute() {
    	return SUCCESS;
    }
    public String listSupportMaterial() {
    	//JOptionPane.showMessageDialog(null, "1");
        dao = new SupportingMaterialDAOImpl();
        spmList = dao.listSPM(checkInclude);
        return SUCCESS;
    }
    public String addSPM(){
    	SupportingMaterialDAOImpl dao = new SupportingMaterialDAOImpl();
    	
    	boolean result = dao.insert(spm);
    	if(result){
    	return SUCCESS;
    	}
    	else
    		return "error";
    }
  

    @Override
    public void validate() {
    }
	public SupportingMaterialVO getSpm() {
		return spm;
	}
	public void setSpm(SupportingMaterialVO spm) {
		this.spm = spm;
	}
    
}